<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div class="box"></div>
  <script>
    const box = document.querySelector('.box')
    //更换背景颜色，css有多个单词的-线的采用驼峰命名法
    box.style.backgroundColor = 'pink'
    box.style.width = '300px'
    box.style.height = '300px'
  </script>
</body>

</html>